package grape.base.rest.user;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by yangwei
 * Created at 2020/9/10 13:17
 */
public class UserLoginHelperDto<K,T> {

    private Map<K, List<T>> dataMap = new HashMap<>();
    private List<T> all;


    public void put(K key, List<T> list) {
        dataMap.put(key, list);
    }
    public void append(K key, List<T> list) {
        List<T> ts = dataMap.get(key);
        if (ts == null) {
            dataMap.put(key, list);
        }else{
            ts.addAll(list);
        }
    }
    public List<T> get(K key) {
        return dataMap.get(key);
    }

    public List<T> getAll() {
        return all;
    }

    public void setAll(List<T> all) {
        this.all = all;
    }

    public Map<K, List<T>> getDataMap() {
        return dataMap;
    }
}
